import React from 'react';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import { HomePage, DashboardPage, AIPage, AboutPage } from '../pages';
import Layout from '../components/Layout';

const router = createBrowserRouter([
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        index: true,
        element: <HomePage />,
      },
      {
        path: 'dashboard',
        element: <DashboardPage />,
      },
      {
        path: 'ai',
        element: <AIPage />,
      },
      {
        path: 'about',
        element: <AboutPage />,
      },
    ],
  },
], {
  basename: '/lingverse'
});

export const AppRouter: React.FC = () => {
  return <RouterProvider router={router} />;
};

export default AppRouter;
